# ***********************************************************************
# JALfs SUPER GLOBALS
# These variables should be definied here as MUTABLE !!
#
# Each module that needs access to these variables, should use
#     from JALfs_globals import *
#
# It can then use these variables in the module and 1 deep functionsm by
#     RS232_buffer.append('M2')
# ***********************************************************************

Version_Nr = '0.2'

odd = True   # ONLY FOR TEST !!!

Line_Delay = 0.5
Line_Nr = 1


# JALfs_globals.py
RS232_Buffer = []


#Serial_HW_Read_out_0 = []
JAL_FO = []

App_Running = False
Virtual_Time = 0
JSM_count = 0               # extra counter to increment virtual time

SS_Reset = 1
SS_Run   = 2
SS_Step  = 3
SS_Stop  = 4
State = SS_Reset

Reload_Exception = "User wants to reload the JAL file"

Form_List = []

hardware_file = None
Main_Form = None
app = None
Program_Directory = None
Active_JAL_File = None
Active_JAL_Dir = None
Programs_Inifile = None
pid_Upload = None
PIC = None
PIC_Time = 0

# the range [0,1,2,...] of normal nets (so no power nets)
N_Normal_Nets = []

# List of all devices (pointers to ..)
Device_List = []

# [ [ (<device_R.tResistor object at 0x01FBCDD0>, 2),
#     (<device_R.tResistor object at 0x01FBCFF0>, 1)],
#   [ (<device_R.tResistor object at 0x01FBCFF0>, 2)],
#   [(<device_R.tResistor object at 0x01FBCDD0>, 1)]]
Net_List = []

# ['N$1', '+5V', 'AGND']
Net_List_Names = []


V_Node = []   # Calculated Voltage at Node
G_Node = []
C_Node = []
T_Node = []   # Type of Node ( Analog / Digital / ...)
#O_Node = []   # In digital nodes: which is the output node

JAL_Globals = []



# ***********************************************************************
# special debug printing procedure
# ***********************************************************************
_pd = True
def pd ( line ):
  if _pd:
    print 20 * '-' +'  '+ line
# ***********************************************************************

# ***********************************************************************
# special debug printing procedure
# ***********************************************************************
def em ( line ):
  print 16 * 'E' +'rror  '+ line
# ***********************************************************************

# to see when it comes here:
#pd ( 'JALfs Globals Imported' )
